<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('parent_id')->nullable()->comment('父级ID');
            $table->string('title')->comment('名称');
            $table->string('code')->unique()->comment('编号');
            $table->string('test_method')->nullable()->comment('检测方法(从字典选择)');
            $table->string('price')->nullable()->comment('终端价');
            $table->unsignedTinyInteger('is_urgent')->default(0)->comment('是否加急，0:否,1:是');
            $table->unsignedTinyInteger('is_package')->default(0)->comment('是否组合项目，0:否,1:是');
            $table->unsignedTinyInteger('is_genetic_disease')->default(0)->comment('是否遗传病类，0:否,1:是');
            $table->unsignedTinyInteger('is_genetic_diagnosis')->default(0)->comment('是否遗传病诊断类，0:否,1:是');
            $table->unsignedTinyInteger('is_family')->default(0)->comment('是否家系模式，0:否,1:是');
            $table->unsignedTinyInteger('is_contain_family')->default(0)->comment('是否含家系，0:否,1:是');
            $table->unsignedTinyInteger('is_more_monitor')->default(0)->comment('是否多次监测，0:否,1:是');
            $table->unsignedTinyInteger('is_alone_order')->default(0)->comment('是否独立开单，0:否,1:是');
            $table->unsignedTinyInteger('is_report')->default(0)->comment('是否出报告，0:否,1:是');
            $table->unsignedTinyInteger('state')->default(1)->comment('是否有效，0:无效,1:有效');
            $table->string('clinical_speciality')->nullable()->comment('所属临床学科');
            $table->string('clinical_significance')->nullable()->comment('临床意义');
            $table->string('modeless_name')->nullable()->comment('无模式简称');
            $table->string('sequencing_strategy')->nullable()->comment('测序策略');
            $table->string('group_special_test')->nullable()->comment('组合项目特殊检测');
            $table->string('member_add_price')->nullable()->comment('增加一个成员的价格');
            $table->string('analytic_strategy')->nullable()->comment('分析策略');
            $table->string('execute_kind')->nullable()->comment('所属执行类别');
            $table->string('analytic_variation_type')->nullable()->comment('分析变异类型');
            $table->string('sample_type_desc')->nullable()->comment('样本类型介绍');
            $table->string('sample_transport')->nullable()->comment('样本储运');
            $table->string('free_verification_num')->nullable()->comment('免费验证总个数');
            $table->string('point_variation_method')->nullable()->comment('点突变验证方法');
            $table->string('point_variation_price')->nullable()->comment('点突变验证价格');
            $table->string('cnv_variation_method')->nullable()->comment('CNV验证方法');
            $table->string('cnv_variation_price')->nullable()->comment('CNV验证价格');
            $table->string('report_period')->nullable()->comment('报告周期（工作日）');
            $table->string('ngs_period')->nullable()->comment('NGS周期（工作日）');
            $table->string('product_attribute')->nullable()->comment('项目属性(从字典选择)');
            $table->text('remark')->nullable()->comment('备注');
            $table->string('monitor_param')->nullable()->comment('检测质量参数');
            $table->string('morepcr_primer')->nullable()->comment('多重PCR引物');
            $table->string('capture_chip')->nullable()->comment('捕获芯片');
            $table->string('sequencing_depth')->nullable()->comment('测序深度');
            $table->string('single_carry_code')->nullable()->comment('单项执行代码');
            $table->string('single_carry_name')->nullable()->comment('单项执行名称');
            $table->string('library_type')->nullable()->comment('文库类型');
            $table->string('method')->nullable()->comment('选择方法');
            $table->string('lci_index')->nullable()->comment('Index');
            $table->string('si_index')->nullable()->comment('Index');
            $table->string('insert_size')->nullable()->comment('插入片段');
            $table->string('target_yield')->nullable()->comment('目标数量');
            $table->string('qc_requirements')->nullable()->comment('QC要求');
            $table->string('sequence_platform')->nullable()->comment('测序平台(从字典选择)');
            $table->string('sequence_type')->nullable()->comment('测序类型(从字典选择)');
            $table->string('sequence_length')->nullable()->comment('测序读长');
            $table->string('client_index')->nullable()->comment('客户指标');
            $table->string('phix')->nullable()->comment('phix%');
            $table->string('delivery_method')->nullable()->comment('数据传输方式');
            $table->string('data_analysis')->nullable()->comment('数据分析');
            $table->string('analysis_details')->nullable()->comment('信息分析明细');
            $table->string('flux')->nullable()->comment('通量');
            $table->string('discount')->nullable()->comment('项目扣率(%)');
            $table->string('product_fee')->nullable()->comment('定价');
            $table->string('way')->nullable()->comment('结款方式(从字典选择)');
            $table->unsignedInteger('created_by')->comment('创建者');
            $table->unsignedInteger('updated_by')->comment('更新者');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '产品表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }

}
